package com.telenav.comm;

public interface ICommCallback
{
    public final static byte SUCCESS = 0;

    public final static byte NO_DATA = 1;
    
    public final static byte TIMEOUT = 2;
    
    public final static byte RESPONSE_ERROR = 3;
    
    public void networkError(CommResponse response);

    public void networkFinished(CommResponse response);

    public void handleChild(CommResponse response);

    public class CommResponse
    {
        public CommResponse(String jobId, byte status)
        {
            this.jobId = jobId;
            this.status = status;
        }
        
        public byte status;

        public byte[] responseData;

        public byte[] requestData;

        public String jobId;

        public String errorMessage;
        
        public Throwable exception;
        
        public boolean isCanceled;       
    }
    
    public boolean isAllowNetworkRequest(CommResponse response);
}
